﻿<script type="text/javascript">
    $(function() {
        $("#ruku_chaxun_wuliao").click(function() {
            //查询
            var dateKaiShi = $("#ruku_date_kaishi_wuliao").datetimebox('getValue');
            var dateJieShu = $("#ruku_date_jieshu_wuliao").datetimebox('getValue');
            var zhanDian = $("#ruku_zhandian_wuliao").combobox('getValue');
            $("#ruku_wuliao").datagrid("load", { zhandian: zhanDian, chengzhongleixing: '入库物料', kaishishijian: dateKaiShi, jieshushijian: dateJieShu, uid: window.uid, kid: window.kid });
        });
        $("#ruku_daochu_wuliao").click(function() {
            //导出
            var dateKaiShi = $("#ruku_date_kaishi_wuliao").datetimebox('getValue');
            var dateJieShu = $("#ruku_date_jieshu_wuliao").datetimebox('getValue');
            var zhanDian = $("#ruku_zhandian_wuliao").combobox('getValue').replace('#', '_');
            var yongHu = $("#currentUser").text();
            window.open(encodeURI("http://keaomds.com:10001/?uid=" + window.uid + "&kid=" + window.kid + "&requestType=4&keHuBianHao=" + window.kehubianhao + "&zhandian=" + zhanDian + "&chengzhongleixing=入库物料&kaishishijian=" + dateKaiShi + "&jieshushijian=" + dateJieShu + "&yonghu=" + yongHu));
        });
        $("#ruku_zhandian_wuliao").combobox({
            url: 'json/zhandian.json',
            method: 'get',
            valueField: 'zhandian',
            textField: 'zhandian',
            panelWidth: 175,
            panelHeight: 'auto',
            editable: false,
            onLoadSuccess: function() {
                $("#ruku_wuliao").datagrid({ url: "handler/wuliaohuizong.ashx", method: "get", queryParams: { zhandian: $("#ruku_zhandian_wuliao").combobox('getValue'), chengzhongleixing: '入库物料', kaishishijian: $("#ruku_date_kaishi_wuliao").datetimebox('getValue'), jieshushijian: $("#ruku_date_jieshu_wuliao").datetimebox('getValue'), uid: window.uid, kid: window.kid }, height: document.body.scrollHeight - 180 });
            }
        });

    });
    
    $.parser.onComplete = function() {
        var d = new Date();
        $("#ruku_date_kaishi_wuliao").datebox('setValue', d.toLocaleDateString());
        $("#ruku_date_jieshu_wuliao").datebox('setValue', d.toLocaleDateString());
    }
</script>
<div class="easyui-panel" data-options="height:90,border:false" title="数据检索" style="border-top-width: 0px;
    border-bottom-width: 1px; padding: 15px; width:100%">
    <table style="font-size: 12px;">
        <tr>
              <td>
                站点：
            </td>
            <td>
                <input class="" name="ruku_zhandian_wuliao" id="ruku_zhandian_wuliao" style="width: 175px;" />
            </td>
            <td>
                称重时间：
            </td>
            <td>
                <input id="ruku_date_kaishi_wuliao" type="text" class="easyui-datebox" data-options="required:true"
                    style="width: 175px">
                至
                <input id="ruku_date_jieshu_wuliao" type="text" class="easyui-datebox" data-options="required:true"
                    style="width: 175px">
            </td>
            <td>
                <a id="ruku_chaxun_wuliao" class="easyui-linkbutton" data-options="iconCls:'icon-search'"
                    style="width: 60px; margin-left: 20px;">查询</a>
            </td>
            <td>
                <a id="ruku_daochu_wuliao" class="easyui-linkbutton" data-options="iconCls:'icon-export-16'"
                    style="width: 60px">导出</a>
            </td>
        </tr>
    </table>
</div>
<table id="ruku_wuliao" class="easyui-datagrid" title="入库物资物料汇总" data-options="border:false,singleSelect:true,collapsible:false,striped:true" style=" width:100%">
    <thead>
        <tr>
            <th data-options="field:'wuliaomingcheng',width:110">
                物料名称
            </th>
            <th data-options="field:'xinghao',width:100">
                型号
            </th>
               <th data-options="field:'cheshu',width:100,align:'right'">
                车数(车)
            </th>
            <th data-options="field:'kouzhong',width:100,align:'right'">
                扣重(吨)
            </th>
            <th data-options="field:'jingzhong',width:100,align:'right'">
                净重(吨)
            </th>
            <th data-options="field:'fahuozhongliang',width:100,align:'right'">
                发货(吨)
            </th>
            <th data-options="field:'jisuanfangliang',width:100,align:'right'">
                方量(方)
            </th>
        </tr>
    </thead>
</table>